/********************************************************************
	created:	2011/04/16
	created:	16:4:2011   23:34
	filename: 	d:\Work\Job\trunk\Speed\Task.h
	file path:	d:\Work\Job\trunk\Speed
	file base:	Task
	file ext:	h
	author:		liang
	
	purpose:	
*********************************************************************/
#ifndef _Task_h_2011_04_16_23_34
#define _Task_h_2011_04_16_23_34

#include <QDateTime>

enum TaskState
{
	Task_None   = 0,
	Task_Running,
	Task_Paused,
	Task_Stop,
};

struct Task
{
	std::string TaskName;
	std::string TaskUrl;
	std::string TaskPath;
	long long Guid;

	unsigned int FileLength;
	float CurrentProcess;
	float CurrentSpeed;
	QDateTime StartTime;
	std::string FileType;
	TaskState  CurrentTaskState;
	void* pUserData;

	Task()
	{
		TaskName = "";
		TaskUrl = "";
		TaskPath = "";
		Guid = 0;
		FileLength = 0;
		CurrentProcess = 0.f;
		CurrentSpeed = 0.f;
		FileType = "";
		CurrentTaskState = Task_None;
		pUserData = NULL;
	}

	bool operator==(const Task& other) const
	{
		return this->Guid == other.Guid;
	}
};

#endif